package com.yss.kettle.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yss.common.core.web.domain.BaseEntity;

/**
 * 日志信息对象 kettle_job_record
 *
 * @author yss
 * @date 2023-04-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("kettle_job_record")
public class JobRecord extends BaseEntity {

    /**
     * 主键
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;

    /**
     * 转换ID
     */
    @ExcelProperty(value = "转换ID")
    @TableField("RECORD_TRANS_ID")
    private String recordTransId;

    /**
     * 启动时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "启动时间")
    @TableField("START_TIME")
    private Date startTime;

    /**
     * 停止时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "停止时间")
    @TableField("STOP_TIME")
    private Date stopTime;

    /**
     * 转换日志记录文件保存位置
     */
    @ExcelProperty(value = "转换日志记录文件保存位置")
    @TableField("LOG_FILE")
    private String logFile;

    /**
     * 分类ID
     */
    @ExcelProperty(value = "分类ID")
    @TableField("JOB_ID")
    private String jobId;

    /**
     * 执行时长
     */
    @ExcelProperty(value = "执行时长")
    @TableField("DURATION")
    private Long duration;

    /**
     * 执行条数
     */
    @ExcelProperty(value = "执行条数")
    @TableField("ROWCOUNT")
    private BigDecimal rowcount;

    /**
     * 执行类型 1作业任务，2明细作业任务
     */
    @ExcelProperty(value = "执行类型 ", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=作业任务,2=明细作业任务")
    @TableField("FTYPE")
    private Integer ftype;

    /**
     * 状态
     */
    @ExcelProperty(value = "状态", converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=正常,2=停用")
    @TableField("STATUS")
    private Integer status;


    @TableField(exist = false)
    private String jobName;

}
